package com.dynabook.ems.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dynabook.ems.common.BaseResponse;
import com.dynabook.ems.model.dto.WorkOrderAddRequest;
import com.dynabook.ems.model.dto.WorkOrderApprovalListRequest;
import com.dynabook.ems.model.dto.WorkOrderListRequest;
import com.dynabook.ems.model.dto.WorkOrderByBomNumRequest;
import com.dynabook.ems.model.dto.request.WorkOrderBatchApprovalRequest;
import com.dynabook.ems.model.dto.request.WorkOrderBatchRejectRequest;
import com.dynabook.ems.model.dto.request.WorkOrderBatchAcceptanceRequest;
import com.dynabook.ems.model.dto.request.WorkOrderBatchDeleteRequest;
import com.dynabook.ems.model.entity.EmsWorkOrder;
import com.dynabook.ems.model.vo.WorkOrderApprovalListVO;
import com.dynabook.ems.model.vo.WorkOrderListVO;
import com.dynabook.ems.model.vo.WorkOrderByBomNumVO;
import com.dynabook.ems.model.dto.WorkOrderExportRequest;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**

* @author tester

* @description 针对表【ems_work_order】的数据库操作Service

* @createDate 2025-07-28 17:23:56
  */
  public interface EmsWorkOrderService extends IService<EmsWorkOrder> {

  /**

  * 新建工单

  * <br />

  * @param workOrderAddRequest 工单新增请求

  * @param request HTTP请求

  * @return 操作结果
    */
    BaseResponse<Boolean> addWorkOrder(WorkOrderAddRequest workOrderAddRequest, HttpServletRequest request);

  /**

  * 分页查询工单列表

  * <br />

  * @param workOrderListRequest 查询条件

  * @return 工单列表
    */
    Page<WorkOrderListVO> getWorkOrderList(WorkOrderListRequest workOrderListRequest);

  /**

  * 分页查询工单审批列表

  * <br />

  * @param workOrderApprovalListRequest 查询条件

  * @return 工单审批列表
    */
    Page<WorkOrderApprovalListVO> getWorkOrderApprovalList(WorkOrderApprovalListRequest workOrderApprovalListRequest);

  /**

  * 批量处理工单申请（同意或拒绝）

  * <br />

  * @param request 批量处理请求
  * @param httpServletRequest HTTP请求

  * @return 操作结果
    */
    BaseResponse<Boolean> batchProcessWorkOrders(WorkOrderBatchRejectRequest request, HttpServletRequest httpServletRequest);

    /**

    * 批量审批生产中的工单

    * <br />

    * @param request 批量审批请求

    * @return 操作结果
      */
      BaseResponse<Boolean> batchApprovalInProductionWorkOrders(WorkOrderBatchApprovalRequest request,HttpServletRequest httpServletRequest);

      BaseResponse<String> getWorkOrderNumber();

    /**
     * 根据BOM号查询关联工单信息
     * 
     * @param request BOM号查询请求（包含分页参数）
     * @return 工单信息响应
     */
    BaseResponse<WorkOrderByBomNumVO> getWorkOrdersByBomNum(WorkOrderByBomNumRequest request);

    /**
     * 批量验收待验收状态的工单
     * 
     * @param request 批量验收请求
     * @param httpServletRequest HTTP请求对象
     * @return 操作结果
     */
    BaseResponse<Boolean> batchAcceptanceWorkOrders(WorkOrderBatchAcceptanceRequest request, HttpServletRequest httpServletRequest);

    /**
     * 批量删除工单（仅限待生产审批和待修改状态）
     * 
     * @param request 批量删除请求
     * @return 操作结果
     */
    BaseResponse<Boolean> batchDeleteWorkOrders(WorkOrderBatchDeleteRequest request);
    
    /**
     * 导出工单数据
     * 
     * @param workOrderExportRequest 导出请求参数
     * @param response HTTP响应对象
     */
    void exportWorkOrderData(WorkOrderExportRequest workOrderExportRequest, HttpServletResponse response);
}
